﻿/*
COPYRIGHT (C) 2009 EPISERVER AB

THIS FILE IS PART OF REMOTE PAGE PROVIDER FOR EPISERVER CMS.
REMOTE PAGE PROVIDER FOR EPISERVER CMS IS FREE SOFTWARE: YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE VERSION v2.1 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION.

REMOTE PAGE PROVIDER FOR EPISERVER CMS IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS.
YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE ALONG WITH REMOTE PAGE PROVIDER FOR EPISERVER CMS]. IF NOT, SEE <HTTP://WWW.GNU.ORG/LICENSES/>.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using EPiServer.Security;
using System.Collections;

namespace EPiServer.Labs.RemoteProvider
{

    /// <summary>
    /// Info about the Remote Virtual Path Providers
    /// </summary>
    [DataContract]
    public class RemoteVirtualPathProviderInfo
    {
     
        public RemoteVirtualPathProviderInfo()
        {
        }

        public RemoteVirtualPathProviderInfo(string name, string virtualPathRoot, string virtualName, bool showInFileManager, bool bypassAccessCheck)
        {
            Name = name;
            VirtualName = virtualName;
            VirtualPathRoot = virtualPathRoot;
            BypassAccessCheck = bypassAccessCheck;
        }

        [DataMember]
        public string Name
        {
            get;
            set;
        }

        [DataMember]
        public string VirtualPathRoot
        {
            get;
            set;
        }

        [DataMember]
        public string VirtualName
        {
            get;
            set;
        }

        [DataMember]
        public bool BypassAccessCheck
        {
            get;
            set;
        }

        [DataMember]
        public bool ShowInFileManager
        {
            get;
            set;
        }

        [DataMember]
        public string Type
        {
            get;
            set;
        }

        [DataMember]
        public bool IsPageFolderVirtualPathProvider
        {
            get;
            set;
        }

        [DataMember]
        public bool SupportFileResolver
        {
            get;
            set;
        }

    }

    [DataContract]
    public class RemoteVirtualPathProvidersInfo
    {
        [DataMember]
        public Dictionary<string, RemoteVirtualPathProviderInfo> VirtualPathProviders
        {
            get;
            set;
        }
    }


    /// <summary>
    /// Summaey info
    /// </summary>
    [DataContract]
    public class RemoteUnifiedSummaryData
    {

      #region Unified Summary
        [DataMember]
        public string Title
        {
            get;
            set;
        }

        [DataMember]
        public string Subject
        {
            get;
            set;
        }

        [DataMember]
        public string Author
        {
            get;
            set;
        }

        [DataMember]
        public string Category
        {
            get;
            set;
        }

        [DataMember]
        public string Keywords
        {
            get;
            set;
        }

        [DataMember]
        public string Comments
        {
            get;
            set;
        }

        [DataMember]
        public bool CanPersist 
        { 
            get; 
            set;
        }

        [DataMember]
        public Hashtable Dictionary
        {
            get;
            set;
        }
        #endregion 
    
    }

    /// <summary>
    /// Remote File info 
    /// </summary>
    [DataContract]
    public class RemoteFileInfo
    {
        #region File Info
        [DataMember]
        public string Name
        {
            get;
            set;
        }

        [DataMember]
        public long Length
        {
            get;
            set;
        }

        [DataMember]
        public string Extension
        {
            get;
            set;
        }


        [DataMember]
        public DateTime Created
        {
            get;
            set;
        }

        [DataMember]
        public DateTime Changed
        {
            get;
            set;
        }

        [DataMember]
        public string VirtualPath
        {
            get;
            set;
        }

        [DataMember]
        public RemoteDirectoryInfo Parent
        {
            get;
            set;
        }

        [DataMember]
        public byte[] Content
        {
            get;
            set;
        }

        [DataMember]
        public RemoteUnifiedSummaryData UnifiedSummaryData
        {
            get;
            set;
        }


        [DataMember]
        public string  ProviderName
        {
            get;
            set;
        }

        #endregion 

    }

    /// <summary>
    /// Remote Directory info
    /// </summary>
    [DataContract]
    public class RemoteDirectoryInfo
    {
        [DataMember]
        public string Name
        {
            get;
            set;    
        }
        [DataMember]
        public bool IsFirstLevel
        {
            get;
            set;
        }

        [DataMember]
        public bool IsDirectory
        {
            get;
            set;
        }

        [DataMember]
        public RemoteDirectoryInfo Parent
        {
            get;
            set;
        }

        [DataMember]
        public AccessLevel AccessLevel
        {
            get;
            set;
        }

        [DataMember]
        public bool BypassAccessCheck
        {
            get;
            set;
        }

        [DataMember]
        public string VirtualPath
        {
            get;
            set;
        }

        [DataMember]
        public string ProviderName
        {
            get;
            set;
        }
    }
}
